package com.fingard.dsp.bank.reqrespobj.exchangerate.detail;

import java.util.HashMap;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.xml.XmlTextWriter;

public class RetAtsExchangeRateDetail extends RetAtsBase {
    public String respCode;
    public String respInfo;
    public String buyrate;//买入牌价（现汇）
    public String sellrate;//卖出牌价（现汇）
    public String buynote;//买入牌价（现钞）
    public String sellnote;//卖出牌价（现钞）
    public String rate;//中间汇率
    public String rateDate;//查询时间
    public String cur;

    public RetAtsExchangeRateDetail(ReqRespHeader p_header){
        retHeader = p_header;
        retXmlWriter = new XmlTextWriter();//用于输出返回ATS的XML报文
    }
    public void writeToXml(XmlTextWriter retXmlWriter){
        retXmlWriter.writeStartElement("DetailRecord");
        retXmlWriter.writeElementString("RespCode", respCode);
        retXmlWriter.writeElementString("RespInfo", respInfo);
        retXmlWriter.writeElementString("BuyRate", buyrate);
        retXmlWriter.writeElementString("SellRate", sellrate);
        retXmlWriter.writeElementString("BuyNote", buynote);
        retXmlWriter.writeElementString("SellNote", sellnote);
        retXmlWriter.writeElementString("Rate", rate);
        retXmlWriter.writeElementString("RateDate", rateDate);
        retXmlWriter.writeElementString("Cur", cur);
    }

    public HashMap<String,String> writeToHash(){
        HashMap<String,String> retHash = new HashMap<String,String>();
        retHash.put("RespCode", respCode);
        retHash.put("RespInfo", respInfo);
        retHash.put("BuyRate", buyrate);
        retHash.put("SellRate", sellrate);
        retHash.put("BuyNote", buynote);
        retHash.put("SellNote", sellnote);
        retHash.put("Rate", rate);
        retHash.put("RateDate", rateDate);
        retHash.put("Cur", cur);
        return retHash;
    }
}
